import waveRequest from "@/api/request.js";

export const fileUploadSingle = (file, userId) => {
    const formData = new FormData();
    formData.append('file', file);
    formData.append('userId', userId);
    return waveRequest({
        method: 'post',
        url: '/fileUpload/upload/single',
        data: formData,
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    });
}


export const fileUploadByList = (data) => waveRequest({
    method: 'post',
    url: '/fileUpload/upload/list',
    data
})

export const fileUploadDelete = (data) => waveRequest({
    url: '/fileUpload/delete',
    method: 'post',
    data
})

export const fileUploadModify = (data) => waveRequest({
    url: '/fileUpload/modify',
    method: 'post',
    data
})

export const fileUploadQuery = (params) => waveRequest({
    url: '/fileUpload/query',
    method: 'get',
    params
})

export const fileUploadList = (params) => waveRequest({
    url: '/fileUpload/list',
    method: 'get',
    params
})

export const fileUploadPage = (params) => waveRequest({
    url: '/fileUpload/page',
    method: 'get',
    params
})

export const fileTypeList = () => waveRequest({
    url: '/fileUpload/fileTypeList',
    method: 'get',
})